#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;

inline int  GetMonthDay(int year, int month)
{
    static int nums[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
    {
        return 29;
    }
    return nums[month];
}
bool GetLess(int year1, int month1, int day1, int year2, int month2, int day2)
{
    if (year1 < year2)
    {
        return true;
    }
    else if (year1 == year2)
    {
        if (month1 < month2)
        {
            return true;
        }
        else if (month1 == month2)
        {
            return day1 < day2;
        }
    }
    return false;
}
int main()
{
    int year1 = 0, month1 = 0, day1 = 0;
    int year2 = 0, month2 = 0, day2 = 0;
    scanf("%4d%2d%2d", &year1, &month1, &day1);
    scanf("%4d%2d%2d", &year2, &month2, &day2);

    int count = 0;
    if (GetLess(year1, month1, day1, year2, month2, day2))
    {
        swap(year1, year2);
        swap(month1, month2);
        swap(day1, day2);
    }
    while (year1 != year2 || month1 != month2 || day1 != day2)
    {
        day2 += 1;
        count++;
        if (day2 > GetMonthDay(year2, month2))
        {
            day2 -= GetMonthDay(year2, month2);
            ++month2;
            if (month2 == 13)
            {
                month2 = 1;
                ++year2;
            }
        }
    }
    cout << count << endl;
}